const TokenKey = 'token'

export function getToken() {
  return uni.getStorageSync(TokenKey)
}

export function setToken(token) {
  return uni.setStorageSync(TokenKey, token)
}

export function removeToken() {
  return uni.removeStorageSync(TokenKey)
}

export const getMiniprogramToken = () => {
	return uni.getStorageSync('token')
}

export function checkToken() {
	if(!getToken()) {
		uni.navigateTo({
			url: "/subPages/login/index"
		});
		return false;
	}else {
		return true;
	}
}
